package service;

import dao.AdminDao;
import entity.Admin;

import java.util.List;

public class AdminService {
    private AdminDao adminDao = new AdminDao();

    /**
     * 用户登录
     * @return true 登陆成功
     */
    public boolean login(Admin admin){
        String sql = "select * from admin where user_name=? and password=?";
        List<Admin> admins = adminDao.query(sql, admin.getUserName(), admin.getPassword());
        return admins != null && !admins.isEmpty();
    }
}
